package com.bzkj.web.controller.basicInfo.stock;

import com.bzkj.basicinfo.domain.stock.WmsStockLogEntity;
import com.bzkj.basicinfo.service.stock.WmsStockLogService;
import com.bzkj.common.core.controller.BaseController;
import com.bzkj.common.core.page.TableDataInfo;
import com.bzkj.common.utils.ServletUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import static com.bzkj.common.core.page.TableSupport.PAGE_NUM;
import static com.bzkj.common.core.page.TableSupport.PAGE_SIZE;

@RestController
@RequestMapping("/wms/stock")
public class WmsStockLogController extends BaseController {

    @Autowired
    private WmsStockLogService stockLogService;

    @GetMapping("/log/list")
    @PreAuthorize("@ss.hasPermi('wms:stock:list')")
    public TableDataInfo list(WmsStockLogEntity entity) {
        Integer pageNum = ServletUtils.getParameterToInt(PAGE_NUM, 1);
        Integer pageSize = ServletUtils.getParameterToInt(PAGE_SIZE, 10);
        return stockLogService.getStockLogList(entity, pageNum, pageSize);
    }
}
